Use ATE 
go 




IF OBJECT_ID ( 'tb_result_DFL', 'U' ) IS NOT NULL 
    DROP table tb_result_DFL;
GO
CREATE table tb_result_DFL
(
resultid int identity(1,1) not null,
partcode varchar(50) not null,
testtime datetime not null,
testperiod int not null,
testequipid varchar(50) not null,
projname varchar(50) not null,
projver varchar(20) not null,
tfpid varchar(60) not null,
userid varchar(50) not null,
totalresult varchar(2) not null,
itemresult varchar(500) not null,
itemselinfo varchar(500) not null,
itemselcnt int not null,
itemcnt int not null,
remark varchar(100),
rowguid uniqueidentifier default newid() primary key
)




IF OBJECT_ID ( 'tb_Param_DFL', 'U' ) IS NOT NULL 
    DROP table tb_Param_DFL;
GO
CREATE table tb_Param_DFL
(
resultid int not null,
partcode varchar(50) not null,
Testequipid varchar(50) not null,
ProcessNum int default 1,
UnitName varchar(50) not null,
testtime datetime not null,
ParamName varchar(50),
Res int not null,
ResValue varchar(50) not null,
ResDesc varchar(255),
rowguid uniqueidentifier default newid() primary key
)





IF OBJECT_ID ( 'tb_DFL_Info', 'U' ) IS NOT NULL 
    DROP table tb_DFL_Info;
GO
CREATE table tb_DFL_Info
(
resultid int not null,
partcode varchar(50) not null,
testtime datetime not null,
Itemcode bigint not null,
ModuleType varchar(50) not null,
Vender varchar(50) not null,
Remark1 varchar(100),
Remark2 varchar(100),
Remark3 varchar(100),
rowguid uniqueidentifier default newid() primary key
)





























